#include <cctype>
#include <cstdio>
#include <cstring>
typedef long long ll;
const int N = 100005, mod = 19961993;
int n, prisum[61][N << 2],
    pri[61] = {0,   2,   3,   5,   7,   11,  13,  17,  19,  23,  29,  31,  37,  41,  43,  47,
               53,  59,  61,  67,  71,  73,  79,  83,  89,  97,  101, 103, 107, 109, 113, 127,
               131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211,
               223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281};

inline int qpow(int base, int exp) {
  int res = 1;
  while (exp) {
    if (exp & 1) {
      res = 1ll * res * base % mod;
    }
    base = 1ll * base * base % mod;
    exp >>= 1;
  }
  return res;
}
inline ll read() {
  ll x = 0;
  int ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return x;
}

inline void pushup(int x) {
  int ls = x << 1, rs = x << 1 | 1;
  for (register int i = 1; i < 61; ++i) {
    prisum[i][x] = prisum[i][ls] + prisum[i][rs];
  }
}

void build(int x, int l, int r) {
  if (l == r) {
    prisum[2][x] = 1;
    return;
  }
  int mid = (l + r) >> 1;
  build(x << 1, l, mid);
  build(x << 1 | 1, mid + 1, r);
  pushup(x);
}

int tmppri[61];
void query(int x, int l, int r, int L, int R) {
  if (L <= l && r <= R) {
    for (register int i = 1; i < 61; ++i) {
      tmppri[i] += prisum[i][x];
    }
    return;
  }
  int mid = (l + r) >> 1;
  if (L <= mid) query(x << 1, l, mid, L, R);
  if (mid < R) query(x << 1 | 1, mid + 1, r, L, R);
}

void modify(int x, int l, int r, int pos) {
  if (l == r) {
    for (register int i = 1; i < 61; ++i) {
      prisum[i][x] = tmppri[i];
    }
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    modify(x << 1, l, mid, pos);
  else
    modify(x << 1 | 1, mid + 1, r, pos);
  pushup(x);
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("con.in", "r", stdin);
  freopen("con.out", "w", stdout);
#endif
#endif
  n = read();
  int a;
  ll b, c;
  build(1, 1, 100000);
  while (n--) {
    a = read(), b = read(), c = read();
    if (a) {
      memset(tmppri, 0, sizeof(tmppri));
      for (register int i = 1; i < 61; ++i) {
        while (true) {
          if (c % pri[i] == 0) {
            c /= pri[i];
            ++tmppri[i];
          } else
            break;
        }
      }
      modify(1, 1, 100000, b);
    } else {
      memset(tmppri, 0, sizeof(tmppri));
      query(1, 1, 100000, b, c);
      ll ans = 1;
      for (register int i = 1; i < 61; ++i) {
        if (tmppri[i]) {
          (ans *= pri[i] - 1) %= mod;
          (ans *= qpow(pri[i], tmppri[i] - 1)) %= mod;
        }
      }
      printf("%lld\n", ans);
    }
  }
  return 0;
}